package com.loser.rpc;

import com.loser.module.base.common.APiResponsePage;
import com.loser.module.base.common.ApiResponse;
import com.loser.rpc.room.dto.req.RoomPageReq;
import com.loser.rpc.room.dto.req.RoomSaveReq;
import com.loser.rpc.room.dto.req.RoomUpdateReq;
import com.loser.rpc.room.dto.resp.RoomInfoResp;
import com.loser.rpc.room.rpc.RoomFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RpcRoomHandler {

    @Autowired
    private RoomFeign roomFeign;

    public ApiResponse<Boolean> save(RoomSaveReq req) {
        return roomFeign.save(req);
    }

    public ApiResponse<Boolean> update(RoomUpdateReq req) {
        return roomFeign.update(req);
    }

    public ApiResponse<Boolean> deleteById(Long id) {
        return roomFeign.deleteById(id);
    }

    public ApiResponse<RoomInfoResp> getById(Long id) {
        return roomFeign.getById(id);
    }

    public APiResponsePage<RoomInfoResp, Object> queryList(RoomPageReq req) {
        return roomFeign.queryList(req);
    }

}
